<template>
  <div class="mainBox">
    <div class="boxProvice">{{ props.obj.name }}</div>
    <div class="boxContent" v-for="item in props.obj.children">{{ item.name }}:{{ item.value }}</div>
  </div>
</template>

<script lang="ts" setup>
import { ref, onMounted } from "vue"
import { getMap } from "../../api/model"
import { deepTree } from "../../../unit/index"

const props: any = defineProps({
  obj: {
    type: Object
  }
})

var mapData: any = ref([])

const getMapData = async () => {
  const { data: { map } } = await getMap({ types: ["map"] })
  mapData.value = deepTree(map)
  console.log('mapData.value', mapData.value);

}

onMounted(() => {
  // console.log('adsfafsdasdfasdfasdf');

  // getMapData()
  console.log('props--------------------------', props.obj);

})
</script>


<style lang="scss" scoped>
.mainBox {
  // border: 1px solid red;
  // background-image: url("../../assets/screen/u4.png");
  // background-size: 100% 100%;
  // background-repeat: no-repeat;

  .boxProvice {
    font-size: 16px;
    font-weight: bold;
    // color: white;
    color: rgb(3, 180, 245);

  }

  .boxContent {
    // border: 1px solid red;
    margin-top: 5px;
    font-size: 14px;
    color: white;
  }
}
</style>